﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="GridPage.aspx.cs" Inherits="Dashboard.TestGrid.GridPage" %>

<%@ Register assembly="GrayParrot.Web.Controls" namespace="GrayParrot.Web.Controls" tagprefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <asp:PlaceHolder ID="PlaceHolder1" runat="server">
        <%: Styles.Render("~/bundles/Datatables/css") %>
        <%: Scripts.Render("~/bundles/Datatables") %>
    </asp:PlaceHolder>
    <!-- Common -->
    <script type="text/javascript" lang="javascript" src="../Scripts/GrayParrot.Core.js"></script>
    <script type="text/javascript" lang="javascript" src="../Scripts/GrayParrot.DataTables.js"></script>
    <script type="text/javascript" lang="javascript" src="../Scripts/GrayParrot.Modals.js"></script> 
    <!-- Common -->

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <!-- 
        Sitemap Menu item:
        <siteMapNode url="~/GridPage.aspx" title="GridPage" description="GridPage" image="fa-warning" id="GridPage"/>
    -->
    <section class="panel">
	        <header class="panel-heading">
				<h2>Test Grid Page</h2>
			</header>
            <div class="panel-tools" align="right">
				<ul class="tooltip-area">
					<li><a href="javascript:Collapse(0)" class="btn btn-collapse" title="Collapse"><i class="fa fa-sort-amount-asc"></i></a></li>
					<li><a href="javascript:Reload(0)" class="btn btn-reload"  title="Reload"><i class="fa fa-retweet"></i></a></li>
					<li><a href="javascript:Close(0)" class="btn btn-close" title="Close"><i class="fa fa-times"></i></a></li>
				</ul>
			</div>

            <div id="ExtFilter"></div>

            <%=this.JQDTable.RenderExternalFilters()%>

              <cc1:JQDataTable ID="JQDTable" runat="server" 
                     SelectionMode="Single" 
                     RenderScripts="false" 
                     BootstrapClasses="table table-hover table-bordered ">
                    <FeaturesConfig>
                        <Features>
                            <cc1:Searching Value="Both" ExternalFilters="true" ExternalFiltersContainerName="ExtFilter"  >
                                <Filters>
                                    <cc1:ColumnFilter ColumnName="FirstName" Type="Text" />
                                    <cc1:ColumnFilter ColumnName="LastName" Type="Text" />
                                    <cc1:ColumnFilter ColumnName="Title" Type="Text" />
                                    <cc1:DateColumnFilter ColumnName="BirthDate" DateFormat="dd/mm/yyyy" IsRange="true" />
                                    <cc1:CustomChoiceFilter ColumnName="PostalCode" DefaultLabel="Postal Code" FilterDefaultLabel="seleziona..." >
                                        <Data>
                                            <cc1:DataItem name="Siaa" value="true" IsDefault="true" />
                                            <cc1:DataItem name="Noaa" value="false" />
                                        </Data>
                                    </cc1:CustomChoiceFilter>
                                </Filters>
                            </cc1:Searching>
                            <cc1:AutoWitdh Value="true" />
                            <cc1:ScrollY Value="500" ScrollCollapse="true" />
                            <cc1:LengthChange Value="true" />
                            <cc1:Paging PagingType="FullNumbers" PageLength="20" />
                        </Features>
                    </FeaturesConfig>
                    <ControllerConfig Url="/api/Employee/Load" LoadingMode="OnLoad">
                    </ControllerConfig>
                    <ColumnsConfig Key="EmployeeId">
                        <Columns>
                            <cc1:TextColumn Name="EmployeeId" Header="Id" Visible="true" />
                            <cc1:TextColumn Name="FirstName" Header="FirstName" />
                            <cc1:TextColumn Name="LastName" Header="LastName" />
                            <cc1:TextColumn Name="Title" Header="Title" DefaultContent="cc" />
                            <cc1:DateColumn Name="BirthDate" Header="Birth Date" />
                            <cc1:TextColumn Name="PostalCode" Header="PostalCode" />
                            <cc1:ActionColumn>
                                <Actions>
                                    <cc1:ActionButton Text="Prova" Callback="SayHello" />
                                    <cc1:ActionLink Text="Vai" Callback="SayHello2" />
                                </Actions>
                            </cc1:ActionColumn>
                        </Columns>
                    </ColumnsConfig>
<%--                    <Toolbar>
                        <cc1:IconButton Icon="fa-plus" Callback="LoadAddDialog" />
                        <cc1:IconButton Icon="fa-edit" Callback="LoadAddDialog" />
                        <cc1:IconButton Icon="fa-minus" Callback="LoadAddDialog" />
                        <cc1:IconButton Icon="fa-trash-o" Callback="LoadAddDialog" />
                    </Toolbar>--%>
                    <Buttons>
<%--                        <cc1:CrudAddButton Text="Aggiungi" Callback="LoadAddDialog" />
                        <cc1:CrudEditButton Text="Modifica" Callback="LoadEditDialog" />
                        <cc1:CrudDeleteButton Text="Cancella" Callback="DeleteDialog" />--%>
                        <cc1:UtilityButton Text="XLS" Type="ExportToExcel" Title="Cronologia" />
                    </Buttons>
                </cc1:JQDataTable>


			
            <footer class="panel-footer" align="right">
				<button type="submit" class="btn" data-color="#F4AD41">Invia</button>
				<button type="reset" class="btn">Cancel</button>
			</footer>

	</section>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="LocaJavascript" runat="server">
  <%=this.JQDTable.RenderScriptsManually()%>

  <script>
      // BOOTSTRAP: Tweaks
      $('.yadcf-filter-wrapper').addClass('input-group');
      $('.yadcf-filter, .yadcf-filter-date', this).addClass('form-control input-sm');
      $('.yadcf-filter-reset-button', this).addClass('btn btn-default btn-sm').wrap('<span class="input-group-btn"></span>');

  </script>
</asp:Content>


